how to do intersection of two sorted array